home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / ai.prl / mike1.exe / KIVA.KB < prev    next >
Encoding:
Text File  |  1990-07-11  |  12.0 KB  |  526 lines

  1. /* KIVA.KB */
  2. /* Archaeology classification example.  Performs analysis of site based on
  3. descriptions of artifacts found at various locations.  The classification
  4. attempts to provide a functional description of the main finds and
  5. features.  For example, a specific artifact might be 'a stone', and
  6. the archaeologist needs to determine whether that stone was actually
  7. used for cooking, sharpening, etc.
  8. To run, be sure to toggle on tracing option number 5, via
  9.      ?- tracing(5).
  10. and invoke the forward chainer via
  11.      ?- fc.
  12. (warning: this kb runs a bit slowly!!!)
  13. At the end of a run, you can use 'describe' to see the additional
  14. 'use' slot which has been added to several objects, and you can
  15. also get explanations for the way in which particular conslusions
  16. were obtained.
  17. Here is an example of how you get an explanation for the route to
  18. a specific conclusion about the use of artifact1:
  19.      ?- how (the use of artifact1 is butchering).
  20.  
  21. */
  22.  
  23. /*
  24. This knowledge base for MIKE is a re-implementation of part of Jitu
  25. Patel's KIVA knowledge base for KEE.  For full details see:
  26.  
  27.         Jitu Patel and Arthur Stutt
  28.         "KIVA: an archaeological interpreter"
  29.            In B. Kelly and A. Rector and (Eds.) , Research and Development in
  30.            Expert Systems V.  Cambridge, UK: Cambridge University Press, 1988.
  31.  
  32. The domain knowledge is (loosely) derived from various accounts of
  33. Pueblo Indian cultures.  Perhaps the most easily accessible of these is
  34. the following
  35.  
  36.          S.H.Lekson, T.C.Windes, J.R.Stein & W.J.Judge
  37.          The Chaco Canyon Community
  38.           Scientific American
  39.           July 1988 Vol. 259 No. 1
  40. */
  41.  
  42. /*
  43. ==========================================================
  44. FACT-FRAMES
  45. ==========================================================
  46.  
  47.              site_facts
  48.             /          \
  49.          finds          features
  50.          /   \              \
  51.        /       \             \
  52.      /           \            \
  53.    artifact  ecofact    enclosing_feature     etc.etc.
  54.  
  55. */
  56.  
  57. finds subclass_of site_facts with
  58.    comment: 'objects found at the site',
  59.    name: unknown,
  60.    location: unknown,
  61.    justification: 'given in Longacre',
  62.    grounds: none.
  63.  
  64. features subclass_of site_facts with
  65.    comment: 'features of the the site',
  66.    name: unknown,
  67.    location: unknown,
  68.    area: unknown,
  69.    justification: 'given in Longacre',
  70.    grounds: none.
  71.  
  72. artifacts subclass_of finds with
  73.    length: unknown,
  74.    use: unknown.
  75.  
  76. ecofacts subclass_of finds with
  77.    date: unknown.
  78.  
  79. e_pollen subclass_of ecofacts with
  80.    kind: unknown.
  81.  
  82. e_wood subclass_of ecofacts with
  83.    kind: unknown.
  84.  
  85. e_bone subclass_of ecofacts with
  86.    age: unknown,
  87.    source: unknown.
  88.  
  89. a_wood subclass_of artifacts with
  90.    kind: unknown,
  91.    point_type: unknown.
  92.  
  93. a_stone subclass_of artifacts with
  94.    type: unknown,
  95.    edge_shape: unknown.
  96.  
  97. a_pottery subclass_of artifacts with
  98.    base: unknown,
  99.    colour: unknown,
  100.    contents: unknown,
  101.    date: unknown,
  102.    diameter: unknown,
  103.    fabric: unknown,
  104.    surface: unknown,
  105.    type: unknown.
  106.  
  107. a_bone subclass_of artifacts with
  108.    date: unknown,
  109.    edge: unknown,
  110.    point: unknown,
  111.    source: unknown,
  112.    texture: unknown,
  113.    type: unknown.
  114.  
  115. flints subclass_of a_stone with
  116.    body: dummy.
  117.  
  118. enclosing_feature subclass_of features with
  119.    name: nil,
  120.    border: stone,
  121.    breadth: 20,
  122.    length: 10,
  123.    location: unknown,
  124.    material: stone,
  125.    placement: above_ground,
  126.    radius: nil,
  127.    shape: quadrilateral.
  128.  
  129. palisade subclass_of enclosing_features with
  130.    radius: unknown,
  131.    height: unknown.
  132.  
  133. ring subclass_of enclosing_features with
  134.    radius: unknown.
  135.  
  136. mound subclass_of features with
  137.    name: nil,
  138.    radius: nil.
  139.  
  140. accumulation subclass_of features with
  141.    name: nil,
  142.    debris: flint_debitage,
  143.    radius: nil,
  144.    state: organized.
  145.  
  146. hole subclass_of features with
  147.    lining: nil,
  148.    material: nil,
  149.    placement: nil,
  150.    radius: nil.
  151.  
  152. refuse_areas subclass_of area with
  153.    location: unknown.
  154.  
  155. manufacturing_refuse subclass_of refuse_areas with
  156.    body: dummy.
  157.  
  158. primary_refuse subclass_of refuse_areas with
  159.    body: dummy.
  160.  
  161. secondary_refuse subclass_of refuse_areas with
  162.    body: dummy.
  163.  
  164. activity_area subclass_of area with
  165.    comment: 'area where significant activity went on',
  166.    activity: unknown,
  167.    enclosed_objects: unknown,
  168.    max_x: unknown,
  169.    max_y: unknown,
  170.    min_x: unknown,
  171.    min_y: unknown.
  172.  
  173. plaza subclass_of activity_area with
  174.    comment: 'external work area'.
  175.  
  176. living_area subclass_of activity_area with
  177.    comment: 'living room'.
  178.  
  179. kiva subclass_of activity_area with
  180.    comment: 'religious/ritual area'.
  181.  
  182. storage_area subclass_of activity_area with
  183.    comment: 'room for storage'.
  184.  
  185. /* 
  186. ===========================================================
  187. FINDS
  188.  
  189. {The following represents a hypothetical Pueblo site}
  190.  
  191. (NB1) only artifacts have been included 
  192. (NB2) the dimensions given are in feet   
  193. ===========================================================
  194. */
  195.  
  196. artifact1 instance_of a_stone with
  197.    edge: straight,
  198.    length: 1.4,
  199.    location: [30,20],
  200.    type: knife.
  201.  
  202. artifact2 instance_of a_stone with
  203.    edge: straight,
  204.    length: 0.7,
  205.    location:[31,20], 
  206.    type: knife.
  207.  
  208. artifact3 instance_of a_stone with
  209.    edge: straight,
  210.    length: 3,
  211.    location:[40,05], 
  212.    type: metate.
  213.  
  214. artifact4 instance_of a_stone with
  215.    edge: straight,
  216.    length: 0.8,
  217.    location:[44,06], 
  218.    type: mano.
  219.  
  220. artifact5 instance_of a_stone with
  221.    edge: convex,
  222.    length: 0.5,
  223.    location:[05,33],
  224.    type: knife.
  225.  
  226. artifact6 instance_of a_stone with
  227.    edge: straight,
  228.    length: 1,
  229.    location:[05,05],
  230.    type: denticulate.
  231.  
  232. artifact7 instance_of a_stone with
  233.    edge: complex,
  234.    length: 1.2,
  235.    location:[06,07],
  236.    type: knife.
  237.  
  238. artifact8 instance_of a_stone with
  239.    edge: straight,
  240.    length: 0.6,
  241.    location:[08,06],
  242.    type: knife.
  243.  
  244. artifact9 instance_of a_stone with
  245.    edge: complex,
  246.    length: 1.1,
  247.    location:[06,30],
  248.    type: projectile_point.
  249.  
  250. artifact10 instance_of a_stone with
  251.    edge: straight,
  252.    length: 1,
  253.    location:[05,32],
  254.    type: axe.
  255.  
  256. artifact11 instance_of a_stone with
  257.    edge: concave,
  258.    length: 0.9,
  259.    location:[33,33],
  260.    type: notch.
  261.  
  262. artifact12 instance_of a_stone with
  263.    edge: convex,
  264.    length: 0.3,
  265.    location:[33,34],
  266.    type: burin.
  267.  
  268. artifact13 instance_of a_stone with
  269.    edge: complex,
  270.    length: 0.5,
  271.    location:[42,45],
  272.    type: projectile_point.
  273.  
  274. artifact16 instance_of a_pottery with
  275.    base: burned,
  276.    colour: black_on_white,
  277.    diameter: 1,
  278.    fabric: fired,
  279.    length: 1.5,
  280.    location:[35,15],
  281.    surface: corrugated,
  282.    type: pot.
  283.  
  284. artifact17 instance_of a_pottery with
  285.    base: not_burned,
  286.    colour: black_on_white,
  287.    diameter: 0.4,
  288.    fabric: fired,
  289.    length: 2,
  290.    location:[30,18],
  291.    surface: painted,
  292.    type: ladle.
  293.  
  294. artifact18 instance_of a_pottery with
  295.    base: not_burned,
  296.    colour: black_on_red,
  297.    diameter: 1,
  298.    fabric: fired,
  299.    length: 1.5,
  300.    location:[42,48],
  301.    surface: painted,
  302.    type: bowl.
  303.  
  304. artifact19 instance_of a_pottery with
  305.    base: not_burned,
  306.    colour: black_on_red,
  307.    diameter: 1,
  308.    fabric: fired,
  309.    length: 2,
  310.    location:[10,32],
  311.    surface: unpainted,
  312.    type: jar.
  313.  
  314. artifact20 instance_of a_pottery with
  315.    base: not_burned,
  316.    colour: black_on_white,
  317.    diameter: 1,
  318.    fabric: fired,
  319.    length: 0.5,
  320.    location:[06,39],
  321.    surface: painted,
  322.    type: mug.
  323.  
  324. artifact21 instance_of a_pottery with
  325.    base: not_burned,
  326.    colour: black_on_white,
  327.    diameter: 1,
  328.    fabric: fired,
  329.    length: 1.6,
  330.    location:[05,37],
  331.    surface: painted,
  332.    type: jar.
  333.  
  334.  
  335. artifact22 instance_of a_pottery with
  336.    base: not_burned,
  337.    colour: black_on_white,
  338.    diameter: 1,
  339.    fabric: fired,
  340.    length: 1.5,
  341.    location:[07,38],
  342.    surface: painted,
  343.    type: bowl.
  344.  
  345. artifact23 instance_of a_pottery with
  346.    base: not_burned,
  347.    colour: black_on_white,
  348.    diameter: 1,
  349.    fabric: fired,
  350.    length: 1.5,
  351.    location:[04,44],
  352.    surface: painted,
  353.    type: pot.
  354.  
  355. artifact24 instance_of a_pottery with
  356.    base: not_burned,
  357.    colour: black_on_white,
  358.    diameter: 1,
  359.    fabric: fired,
  360.    length: 1.5,
  361.    location:[05,42],
  362.    surface: painted,
  363.    type: pot.
  364.  
  365. artifact25 instance_of a_pottery with
  366.    base: not_burned,
  367.    colour: black_on_white,
  368.    diameter: 0.7,
  369.    fabric: fired,
  370.    length: 1.5,
  371.    location:[06,40],
  372.    surface: painted,
  373.    type:jar.
  374.  
  375. artifact26 instance_of a_pottery with
  376.    base: not_burned,
  377.    colour: black_on_white,
  378.    diameter: 0.6,
  379.    fabric: fired,
  380.    length: 2,
  381.    location:[03,39],
  382.    surface: painted,
  383.    type: ladle.
  384.  
  385.  
  386.  
  387.  
  388. /*
  389. ===========================================================
  390. EXAMPLE RULES
  391. ===========================================================
  392.  */
  393.  
  394. /* uses of stone artifacts */
  395.  
  396. rule s1 forward
  397.     if
  398.      Artifact instance_of a_stone &
  399.      the type of Artifact is projectile_point &
  400.      the length of Artifact is Len &
  401.      prolog(Len > 1)
  402.     then
  403.       note the use of Artifact is digging.
  404.  
  405. rule s1a forward
  406.     if
  407.      Artifact instance_of a_stone &
  408.      the type of Artifact is scraper &
  409.      the length of Artifact is Len &
  410.      prolog(Len > 1)
  411.     then
  412.       note the use of Artifact is digging.
  413.  
  414. rule s2 forward
  415.     if
  416.      Artifact instance_of a_stone &
  417.      the type of Artifact is projectile_point &
  418.      the length of Artifact is Len &
  419.      prolog(Len < 1)
  420.     then
  421.       note the use of Artifact is hunting.
  422.  
  423. rule s3 forward
  424.     if
  425.      Artifact instance_of a_stone &
  426.      the type of Artifact is denticulate
  427.     then
  428.       note the use of Artifact is cloth_working.
  429.  
  430. rule s4 forward
  431.     if
  432.      Artifact instance_of a_stone &
  433.      the type of Artifact is notch &
  434.      the edge of Artifact is concave
  435.     then
  436.       note the use of Artifact is wood_working.
  437.  
  438. rule s4a forward
  439.     if
  440.      Artifact instance_of a_stone &
  441.      the type of Artifact is burin &
  442.      the edge of Artifact is concave
  443.     then
  444.       note the use of Artifact is wood_working.
  445.  
  446. rule s5 forward
  447.     if
  448.      Artifact instance_of a_stone &
  449.      the type of Artifact is notch &
  450.      the edge of Artifact is straight
  451.     then
  452.       note the use of Artifact is bone_working.
  453.  
  454. rule s5a forward
  455.     if
  456.      Artifact instance_of a_stone &
  457.      the type of Artifact is notch &
  458.      the edge of Artifact is complex
  459.     then
  460.       note the use of Artifact is bone_working.
  461.  
  462. rule s5b forward
  463.     if
  464.      Artifact instance_of a_stone &
  465.      the type of Artifact is burin &
  466.      the edge of Artifact is straight
  467.     then
  468.       note the use of Artifact is bone_working.
  469.  
  470. rule s5c forward
  471.     if
  472.      Artifact instance_of a_stone &
  473.      the type of Artifact is burin &
  474.      the edge of Artifact is complex
  475.     then
  476.       note the use of Artifact is bone_working.
  477.  
  478. rule s6 forward
  479.     if
  480.      Artifact instance_of a_stone &
  481.      the type of Artifact is metate
  482.     then
  483.       note the use of Artifact is food_preparation.
  484.  
  485. rule s6a forward
  486.     if
  487.      Artifact instance_of a_stone &
  488.      the type of Artifact is mano
  489.     then
  490.       note the use of Artifact is food_preparation.
  491.  
  492. rule s7 forward
  493.     if
  494.      Artifact instance_of a_stone &
  495.      the type of Artifact is knife &
  496.      the length of Artifact is Len &
  497.      prolog(Len > 1)
  498.     then
  499.       note the use of Artifact is butchering.
  500.  
  501. rule s8 forward
  502.     if
  503.      Artifact instance_of a_stone &
  504.      the type of Artifact is knife &
  505.      the length of Artifact is Len &
  506.      prolog(Len < 1)
  507.     then
  508.       note the use of Artifact is cutting.
  509.  
  510. rule s9 forward
  511.     if
  512.      Artifact instance_of a_stone &
  513.      the type of Artifact is scraper &
  514.      the length of Artifact is Len &
  515.      prolog(Len < 1)
  516.     then
  517.       note the use of Artifact is hide_working.
  518.  
  519. rule s10 forward
  520.     if
  521.      Artifact instance_of a_stone &
  522.         the type of Artifact is axe &
  523.      the edge of Artifact is straight
  524.       then
  525.         note the use of Artifact is butchering.
  526.